package com.xiaozhu.handler;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @author 朱慧军
 * @version 1.0
 */

@RestControllerAdvice
@Slf4j
public class GlobalException {

    @ExceptionHandler(value = Exception.class)
    public String exceptionHandler(Exception e){
        log.error("异常信息;{}",e.getMessage());
        return e.getMessage();
    }
}
